{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Length of stay in the ICU"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "This document shows how Jupyter Notebooks can be used to create a reproducible analysis using MIMIC-III. Let's calculate the median length of stay in the ICU and then include this value in our Notebook."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Import libraries\n",
    "import pandas as pd\n",
    "import matplotlib.pyplot as plt\n",
    "import psycopg2\n",
    "import getpass\n",
    "%matplotlib inline\n",
    "plt.style.use('ggplot') "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Create a database connection\n",
    "user = 'postgres'\n",
    "host = 'localhost'\n",
    "dbname = 'mimic'\n",
    "schema = 'mimiciii_demo'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Password:········\n"
     ]
    }
   ],
   "source": [
    "# Connect to the database\n",
    "con = psycopg2.connect(dbname=dbname, user=user, host=host, \n",
    "                       password=getpass.getpass(prompt='Password:'.format(user)))\n",
    "cur = con.cursor()\n",
    "cur.execute('SET search_path to {}'.format(schema))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Get length of stay from the icustays table\n",
    "query = \\\n",
    "\"\"\"\n",
    "SELECT i.subject_id, i.hadm_id, i.los\n",
    "FROM icustays i;\n",
    "\"\"\"\n",
    "\n",
    "data = pd.read_sql_query(query,con)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>subject_id</th>\n",
       "      <th>hadm_id</th>\n",
       "      <th>los</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>10006</td>\n",
       "      <td>142345</td>\n",
       "      <td>1.6325</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>10011</td>\n",
       "      <td>105331</td>\n",
       "      <td>13.8507</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>10013</td>\n",
       "      <td>165520</td>\n",
       "      <td>2.6499</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>10017</td>\n",
       "      <td>199207</td>\n",
       "      <td>2.1436</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>10019</td>\n",
       "      <td>177759</td>\n",
       "      <td>1.2938</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   subject_id  hadm_id      los\n",
       "0       10006   142345   1.6325\n",
       "1       10011   105331  13.8507\n",
       "2       10013   165520   2.6499\n",
       "3       10017   199207   2.1436\n",
       "4       10019   177759   1.2938"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Display the first few rows of the data\n",
    "data.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "2.11145\n"
     ]
    }
   ],
   "source": [
    "# Compute the median LOS\n",
    "avg_los = data.los.median()\n",
    "print(avg_los)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0x1148ddd50>"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZAAAAEECAYAAAAGSGKZAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAGi9JREFUeJzt3X9wFPXh//HX5WKgF0J+EgZIYyg/hnLQqgRh6JQAoaNF\nRlIqqcBQobbO8PtHtUgdq7WIUn5GgRSpCrWOEgeIg2WqM0oQZShJgTFcmk8Kg7RIISG/uBBC4G6/\nf0TuSyDIZnPJ3oXnYyZDdvO+29dtSF63+77bOAzDMAQAQCtF2B0AABCeKBAAgCUUCADAEgoEAGAJ\nBQIAsIQCAQBYEtlRG8rNzdXhw4cVGxur1atXS5Lq6uq0fv16VVRUKDk5WYsXL5bL5ZIkvfHGGzp6\n9Ki6dOmiuXPnKi0traOiAgBM6LAjkLFjx+qZZ55pti4/P19Dhw5VTk6O3G63du3aJUk6cuSIzp07\np1deeUVPPPGEtmzZYno7Ho8nqLnbCzmDKxxyhkNGiZzB1plzdliBDBo0SNHR0c3WFRUVKSMjQ5I0\nZswYFRUVSZIKCwsD6wcMGKD6+nrV1NSY2k5n/mbZgZzBEw4ZJXIGW2fOaescSG1treLi4iRJcXFx\nqq2tlSRVVVUpMTExMC4hIUFVVVW2ZAQAtCxsJtEdDofdEQAA1+mwSfSWxMXFqaamJvBvbGyspKYj\njsrKysC4yspKxcfHt3gfHo+n2aFXdnZ2+4YOEnIGVzjkDIeMEjmDLZxy5uXlBZbdbrfcbvc33qZD\nC8QwDF1/7cZhw4apoKBAWVlZKigoUHp6uiQpPT1dH374oUaNGqWysjJFR0cHTnXdqKUHeebMmfZ7\nEEESExMjr9drd4zbImfwhENGiZzBFi45e/fu3eqy67ACycnJ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t/3kv\nLS1VUVGR5s2bp5ycHB07dkxbt25VfX19q/dlpykQsxdftNvly5fV0NAgqelZ3xdffKFvf/vbNqf6\n/258JjJs2DAVFBRIkgoKCkJin96Y8dovZEn6xz/+ETL7Mzc3VykpKZowYUJgXSjuz5Zyhto+vXDh\nQuB0S2Njo4qLi5WSkiK3262DBw9Kkvbt22fr/mwpY+/evQP70jAMHTp0yPZ9OW3aNOXm5mrDhg1a\ntGiRhgwZogULFljal53qnehHjx7Vm2++Gbj4Yii+jLe8vFyrVq2Sw+GQz+fTD3/4w5DJmZOTo5KS\nEnm9XsXGxio7O1vDhw/XunXrdP78eSUlJWnJkiUtTmLbmdHj8ejLL7+Uw+FQjx499MQTTwSe9dml\ntLRUzz33nFJTU+VwOORwODR16lT1798/pPbnrXJ+9tlnIbVP//Of/2jjxo3y+/0yDEOjRo3S5MmT\nVV5ervXr1+vixYtKS0vT/PnzbZtfuFXGF154QV6vV4ZhKC0tTb/61a8Ck+12Kykp0e7duwMv423t\nvuxUBQIA6Did5hQWAKBjUSAAAEsoEACAJRQIAMASCgQAYAkFAgCwhAIBAFhCgQAALPl/E8mueMnB\n9yAAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x111591590>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Plot the distribution\n",
    "data.los.plot(kind='hist')"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
